<?php

namespace app\common\model;

use app\common\RootModel;

class MoneyCashModel extends RootModel
{
    protected $pk = 'id';
    protected $table = 'sys_member_money_cash';

    /**
     * 钱包类型
     * @var array
     */
    public static $typeLabel = ['Momo', 'Binance'];

    /**
     * 打款
     * @var string[]
     */
    public static $stateEdit = [0 => '提现失败', 2 => '立即打款'];

    /**
     * 支付状态
     * @var string[]
     */
    public static $stateLabel = ['交易失败', '待审核', '打款中', '交易完成'];

    /**
     * 支付状态
     * @var string[]
     */
    public static $payLabel = ['提现失败', '提现中', 3 => '提现成功'];

    /**
     * 提现状态
     * @return array
     */
    public static function stateLabels()
    {
        return [lang('fail'), lang('processing'), lang('processing'), lang('complete')];
    }

    /**
     * 通知内容
     * @return \think\model\relation\HasOne
     */
    public function notify()
    {
        return $this->hasOne(NotifyModel::class, 'cash_id', 'id');
    }
}